/*
 * Example: Declare array, use variable as the size
 *
 * Date: Oct.2.2014
 *
 * Reference: http://www.cplusplus.com/doc/tutorial/dynamic/
 *
 * Note:  
 */

#include <iostream>

using namespace std;

int main()
{
  int array_1[10];
  array_1[0] = 1;
  cout << "array_1[0] = " << array_1[0] << endl;

  int n = 3;
  int array_2[n];
  array_2[2] = 10;
  cout << "array_2[2] = " << array_2[2] << endl;

  cout << "Please input the size of array_3:";
  cin >> n;
  int array_3[n];
  array_3[n - 1] = 7;
  cout << "array_3[" << n - 1 << "] = " << array_3[n - 1] << endl;

  return 0;
}
